package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName sn_table
 */
@TableName(value ="sn_table")
@Data
public class SnTable implements Serializable {
    /**
     * 编号
     */
    @TableId(type = IdType.AUTO)
    private Integer snId;

    /**
     * 物料编码
     */
    private String materialCode;

    /**
     * 规格型号
     */
    private String specificationModel;

    /**
     * 批次号
     */
    private String batchNumber;

    /**
     * sn码数量
     */
    private Integer snCodeQuantity;

    @TableField(exist = false)
    private ProductMaterialManagement productMaterialManagement;
    @TableField(exist = false)
    private Units units;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SnTable other = (SnTable) that;
        return (this.getSnId() == null ? other.getSnId() == null : this.getSnId().equals(other.getSnId()))
            && (this.getMaterialCode() == null ? other.getMaterialCode() == null : this.getMaterialCode().equals(other.getMaterialCode()))
            && (this.getSpecificationModel() == null ? other.getSpecificationModel() == null : this.getSpecificationModel().equals(other.getSpecificationModel()))
            && (this.getBatchNumber() == null ? other.getBatchNumber() == null : this.getBatchNumber().equals(other.getBatchNumber()))
            && (this.getSnCodeQuantity() == null ? other.getSnCodeQuantity() == null : this.getSnCodeQuantity().equals(other.getSnCodeQuantity()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSnId() == null) ? 0 : getSnId().hashCode());
        result = prime * result + ((getMaterialCode() == null) ? 0 : getMaterialCode().hashCode());
        result = prime * result + ((getSpecificationModel() == null) ? 0 : getSpecificationModel().hashCode());
        result = prime * result + ((getBatchNumber() == null) ? 0 : getBatchNumber().hashCode());
        result = prime * result + ((getSnCodeQuantity() == null) ? 0 : getSnCodeQuantity().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", snId=").append(snId);
        sb.append(", materialCode=").append(materialCode);
        sb.append(", specificationModel=").append(specificationModel);
        sb.append(", batchNumber=").append(batchNumber);
        sb.append(", snCodeQuantity=").append(snCodeQuantity);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}